entry: don't blindly center the text area in the allocated height
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 30 Jan 2012 19:05:16 +0000 (14:05 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 31 Jan 2012 15:04:25 +0000 (10:04 -0500)
Since top/bottom borders might be different.

gtk/gtkentry.c

index 4f0d909998c24810f0ecf3511a372cc227feb057..f094fd2b970145ba0c27ecada0516c7b4b061220 100644 (file)
@@ -3228,7 +3228,7 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
     *x = borders.left;
 
   if (y)
-    *y = frame_height / 2 - (req_height - borders.top - borders.bottom) / 2;
+    *y = floor ((frame_height - req_height) / 2) + borders.top;
 
   if (width)
     *width = allocation.width - borders.left - borders.right;